// import { postRequest, getRequest } from "@/utils/request";
import { getRequest1, postRequest1 } from "@/utils/request1";

import permissionsData from "@/assets/json/permissions.json";
// 获取商户基本信息
export const GetMerchantInfo = () => {
  return getRequest1("/api/v2/cms/merchant/info");
};

// 创建子账号
export const CreateAccount = (data) => {
  return getRequest1("/api/v2/cms/account/create", data);
};

// 获取子账号列表
export const GetAccountList = (data) => {
  return getRequest1("/api/v2/cms/account/list", data);
};

// 获取单个账号详情
export const accountInfoApi = (data) => {
  return getRequest1("/api/v2/cms/account/info", data);
};

//更新更新子账号
export const accountUpdateApi = (data) => {
  return postRequest1("/api/v2/cms/account/update", data);
};

//删除子账号列表
export const DeleteAccountItem = (data) => {
  return getRequest1("/api/v2/cms/account/delete", data);
};

//更新商户信息
export const merchantUpdateApi = (data) => {
  return postRequest1("/api/v2/cms/merchant/update", data);
};

//角色权限列表
export const permissionsListGroupApi = (data) => {
  return getRequest1("/api/v2/cms/permissions/list_group", data);
};

//添加身份组权限
export const addPermissionsGroupApi = (data) => {
  return postRequest1("/api/v2/cms/permissions/add_group", data);
};
//修改身份组权限
export const updatePermissionsGroupApi = (data) => {
  return postRequest1("/api/v2/cms/permissions/update_group", data);
};
//角色组删除
export const deletePermissionsGroupApi = (data) => {
  return getRequest1("/api/v2/cms/permissions/delete_group", data);
};
//单个权限组信息
export const permissionsInfoGroupApi = (data) => {
  return getRequest1("/api/v2/cms/permissions/info_group", data);
};
//创建子账号时的下拉角色列表
export const accountRoleListApi = (data) => {
  return getRequest1("/api/v2/cms/account/role_list", data);
};

//获取权限菜单配置
export const permissionsApi = (data) => {
  return getRequest1("/api/v2/cms/permissions/info", data);
};

//获取登录用户权限code
export const permissionsUserApi = (data) => {
  return getRequest1("/api/v2/cms/permissions/user", data);
};

// ============================ 加密接口 ================================
// 获取商户基本信息
export const GetNewMerchantInfo = () => {
  return getRequest1("/api/v2/user/info");
};
